Licensing API
Generate Machine ID
POST /api/v1/license/machine-id/generate
Generates a machine ID for the Spectra Analyze appliance. This machine ID can be emailed to ReversingLabs support to obtain a valid license file. If the machine ID is regenerated, the appliance has to be licensed again, unless it is licensed using a Spectra Intelligence account. Once ReversingLabs support replies with a license file, upload it to the appliance using the Upload license file endpoint, or using the GUI.
Response Status Codes
CODE | DESCRIPTION |
---|---|
201 | OK |
400 | Bad Request |
Response Format
{
"machineId": "string"
}
Request Examples
cURL
curl -X POST 'https://example.appliance.com/api/v1/license/machine-id/generate' \
--header 'Authorization: Token exampletoken'
Python
import requests
# Change the token
token = "exampletoken"
# Change the hostname in the URL
url = "https://example.appliance.com/api/v1/license/machine-id/generate"
payload = {}
headers = {
"Authorization": f"Token {token}"
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Upload license file
PUT /api/v1/license/upload
Uploads a license file to Spectra Analyze. To obtain a license file, request it from ReversingLabs support by sending the Spectra Analyze machine ID which can be found in the Licensing section of the appliance, in the License information query response, or (re)generated using the Generate Machine ID endpoint. This API requires a valid token.
Request Parameters
The file must be provided as an argument to the file
parameter. The request payload type must be multipart/form-data
.
Response Status Codes
CODE | DESCRIPTION |
---|---|
200 | OK |
201 | OK |
400 | Bad Request |
502 | Bad Gateway |
Request Examples
cURL
# Add --insecure before the URL if you are using a self-signed SSL certificate
curl -X PUT 'https://appliance.example.com/api/v1/license/upload' \
--header 'Authorization: Token exampletoken' \
--form 'file=@licensefile'
Python
import requests
# Change the token
token = "exampletoken"
# Change the hostname in the URL
url = "https://example.appliance.com/api/v1/license/upload"
files=[
('file',('license',open('/path/to/license','rb'),'multipart/form-data'))
]
headers = {
"Authorization": f"Token {token}"
}
# Add verify=False in the request if you are using a self-signed SSL certificate
response = requests.request("PUT", url, headers=headers, files=files)
print(response.text)
Spectra Intelligence License
POST /api/v1/license/configure/cloud
Configures the Spectra Intelligence account on the appliance. Appliances with a valid Spectra Intelligence account are considered licensed as long as they can reach Spectra Intelligence. If not, the appliance enters a 14-day grace period during which it’s still considered licensed.
Response Status Codes
CODE | DESCRIPTION |
---|---|
200 | OK |
Request Parameters
url | The host address for the Spectra Intelligence service. The default URL is https://appliance-api.reversinglabs.com |
---|---|
user | Spectra Intelligence username for authentication. Every Spectra Analyze instance must be connected to its own Spectra Intelligence account. Sharing accounts between multiple instances can interfere with the functionality of the appliance (particularly with YARA rule synchronization). |
token | Spectra Intelligence password for authentication. Every Spectra Analyze instance must be connected to its own Spectra Intelligence account. Sharing accounts between multiple instances can interfere with the functionality of the appliance (particularly with YARA rule synchronization). |
timeout | Default Spectra Intelligence service connection timeout in seconds (maximum 1000). |
proxy_host | Optional proxy host name for routing requests from the appliance to Spectra Intelligence (e.g., 192.168.1.15). If configured, this proxy will also be used by the Local URL crawling method and all integrations on the Spectra Analyze appliance. |
proxy_port | Optional proxy port number (e.g., 1080). |
proxy_user | Username for proxy authentication (if proxy is configured). |
proxy_password | Password for proxy authentication (if proxy is configured). |
POST Body Example
{
"url": "https://appliance-api.reversinglabs.com",
"user": "string",
"token": "string",
"timeout": 1,
"proxy_host": "string",
"proxy_port": 0,
"proxy_user": "string",
"proxy_password": "string"
}
Request Examples
cURL
# Add --insecure before the URL if you are using a self-signed SSL
curl -X POST 'https://appliance.example.com/api/v1/license/configure/cloud' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token exampletoken' \
--data '{
"url": "https://appliance-api.reversinglabs.com",
"user": "string",
"token": "string",
"timeout": 1,
"proxy_host": "string",
"proxy_port": 0,
"proxy_user": "string",
"proxy_password": "string"
}'
Python
import requests
import json
# Change the token
token = "exampletoken"
# Change the hostname in the URL
url = "https://appliance.example.com/api/v1/license/configure/cloud"
json = {
"url": "https://appliance-api.reversinglabs.com",
"user": "string",
"token": "string",
"timeout": 1,
"proxy_host": "string",
"proxy_port": 0,
"proxy_user": "string",
"proxy_password": "string"
}
headers = {
"Authorization": f"Token {token}"
}
response = requests.request("POST", url, headers=headers, json=json)
print(response.text)
License Information
GET /api/v1/license/
Retrieves the status of the license and generates a machine ID if it doesn’t already exist. Unlicensed appliances can be licensed by connecting the appliance to Spectra Intelligence using the Spectra Intelligence License endpoint, or by sending the Machine ID to ReversingLabs support via email and uploading the license file they provide to the appliance using the Upload license file endpoint.
Response Status Codes
CODE | DESCRIPTION |
---|---|
200 | OK |
502 | Bad Gateway |
Response Format
{
"status": "VALID",
"product": "A1000",
"machineId": "string",
"version": 0,
"serialNumber": "string",
"licenseType": "WILDCARD",
"company": "string",
"expiryDate": "2024-08-24",
"creationDate": "2023-08-24"
}
License status
GET /api/v1/license/status/
Returns the current status of the license.
Response Status Codes
CODE | DESCRIPTION |
---|---|
200 | OK |
502 | Bad Gateway |
Response Format
{
"status": "VALID"
}
Request Examples
cURL
curl -X GET 'https://example.appliance.com/api/v1/license/status/' \
--header 'Authorization: Token exampletoken'
Python
import requests
# Change the token
token = "exampletoken"
# Change the hostname in the URL
url = "https://example.appliance.com/api/v1/license/status/"
payload = {}
headers = {
"Authorization": f"Token {token}"
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)